package com.gg.user.controller;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "LogoutServlet", value = "/user/LogoutServlet")
public class LogoutServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        /*1.杀死Session对象*/
        request.getSession().invalidate();
        /*2.跳转回主页*/
        response.sendRedirect("/fruit/index.jsp");
    }
}
